/*
 * HalSocket.h
 *
 *  Created on: 06-11-2011
 *      Author: cristian
 */

#ifndef HALSOCKET_H_
#define HALSOCKET_H_

#include "Logger.h"
#include "Socket.h"
#include "WorkerSpaceException.h"
#define PUERTO 9999
#define HOST_SERVER "localhost"

class HalSocket: private Socket {

private:
	Logger* logger;

	bool isServer;

public:
	HalSocket();
	HalSocket(bool isServer, bool isClient);
	virtual ~HalSocket();
	void closeSock();
	void server(int port);
	void client(std::string host, int port);
	bool isIsServer() const;
	void setIsServer(bool isServer);
	void accept(HalSocket& sock);

	const HalSocket& operator <<(const std::string&) const;
	const HalSocket& operator >>(std::string&) const;

	string* getIp(HalSocket* socketaddr);


};

#endif /* HALSOCKET_H_ */
